<div class="hot-users" id="userRecommend">
    <!-- 显示热门帖子 -->
    <h3 class="block-head">
        <i class="fa fa-trophy" style="margin-right:10px;font-size: 18px"></i>热门帖子
        <div class="hot-sw">
            <span class="listType" style="margin-right:10px;cursor: pointer" data-type="week">周榜</span>
            <font style="color: #e5e5e5">|</font>
            <span class="act listType" style="margin-left:10px;cursor: pointer" data-type="total">总榜</span>
        </div>
    </h3>
    <!-- END -->

    <!-- 周榜 -->
    <ul id="weekList" style="display: none;">
        {eju:volist name="$eju.field.WeekList" id="week"}
        <a href="{$week.AskUrl}" target="_blank">
            <li>
                <div class="hot-user-avter">{$key+1}</div>
                <div class="hot-user-info">
                    <div class="hot-nice">{$week.ask_title}</div>
                </div>
            </li>
        </a>
        {/eju:volist}
    </ul>
    <!-- END -->

    <!-- 总榜 -->
    <ul id="totalList">
        {eju:volist name="$eju.field.TotalList" id="total"}
        <a href="{$total.AskUrl}" target="_blank">
            <li>
                <div class="hot-user-avter">{$key+1}</div>
                <div class="hot-user-info">
                    <div class="hot-nice">{$total.ask_title}</div>
                </div>
            </li>
        </a>
        {/eju:volist}
    </ul>
    <!-- END -->
</div>

<script type="text/javascript">
    $(function() {
        // 排行榜
        $('.listType').hover(function() {
            $('.hot-sw').find('span').removeClass('act');
            $(this).addClass('act');
            var type = $(this).data('type');
            if ('week' == type) {
                $('#weekList').show();
                $('#totalList').hide();
            } else {
                $('#weekList').hide();
                $('#totalList').show();
            }
        });
    });
</script>